import request from '@/common/vmeitime-http';

/**
 * @desc 我要卖房提交房屋权利人表单信息
 * @params id quanliren、card、housecard、wuye、zulin、diyaren、daikuan、xiu、other
 */
export function submitHouseOwnerMsg(data){
    return request.request({
        url: `/esign/mall/sign/fill/${data.id}`,
        method: 'post',
        data
    })
}

/**
 * @desc 识别房产证图片信息
 * @param image {String} 上传阿里云之后的路径key
 */
export function imageToMessage(data) {
   return request.request({
     url: `/esign/mall/ocr/estate`,
     method: 'post',
     data
   })
}

/**
 * @desc 查看合同
 * @param id {Number} 房源ID
 */
export function checkContractAPI(id) {
   return request.request({
     url: `/esign/mall/file/download/${id}`
   })
}

/**
 * @desc 获取求购下拉数据parmas
 */
export function defaultParams() {
   return request.request({
     url: `/product/mall/buy/params`
   })
}

/**
 * @desc 我要求购:获取求购列表、创建求购
 * @param method {String} get post
 */
export function purchaseAPI(data) {
   return request.request({
     url: `/product/mall/buy/create`,
     method: data.method,
     data
   })
}

/**
 * @desc 获取/修改求购内容详情
 * @param method {String} get put
 * @param id
 */
export function purchaseDetailAPI(data) {
   return request.request({
     url: `/product/mall/buy/detail/${data.id}`,
     method: data.method,
     data: data.method=='get'?"":data
   })
}

/**
 * 判断发布房源是否上限
 */
export function checkProductsLimit() {
   return request.request({
     url: `/product/mall/sell/year/count`
   })
}